const fs = require('fs')

const varsContent = fs.readFileSync('./src/styles/vars.scss', 'utf-8')

const rtv = {}

varsContent.split('\n').forEach((line) => {
  if (line) {
    const [key, val] = line.split(':')

    if (val) {
      rtv[key.trim().slice(1)] = val.split(';')[0].trim()
    }
  }
})

fs.writeFileSync('./src/styles/vars.json', JSON.stringify(rtv, null, 2))
